<template>
  <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
    <van-swipe-item v-for="(item, index) in banner" :key="index">
      <router-link :to="`/detail/${item.id}`">
        <img class="bannerPicture" :src="item.image" />
        <div class="inner">
          <p class="title">{{ item.title }}</p>
          <p class="hint">{{ item.hint }}</p>
        </div>
      </router-link>
    </van-swipe-item>
  </van-swipe>
</template>

<script>
export default {
  props: {
    banner: {
      type: [],
      required: true,
    },
  },
  setup() {},
};
</script>

<style lang="less" scoped>
.my-swipe .van-swipe-item {
  font-size: 20px;
  //   line-height: 150px;
  //   text-align: center;
  background-color: #39a9ed;
  height: 300px;
  position: relative;
}
.bannerPicture {
  width: 100%;
  height: 100%;
}
.inner {
  position: absolute;
  bottom: 20px;
  left: 10px;
  .title {
    line-height: 25px;
    color: #fff;
  }
  .hint {
    margin-top: 10px;
    font-size: 12px;
    color: #eee;
  }
}
</style>